/************************************************************************/
/*Copyright (c) James Zhao 2007,2008
/*This file is part of AdminOverlay.
/*AdminOverlay is free software: you can redistribute it and/or modify
/*it under the terms of the GNU General Public License as published by
/*the Free Software Foundation, either version 3 of the License, or
/*(at your option) any later version.
/*
/*AdminOverlay is distributed in the hope that it will be useful,
/*but WITHOUT ANY WARRANTY; without even the implied warranty of
/*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
/*GNU General Public License for more details.
/*
/*You should have received a copy of the GNU General Public License
/*along with AdminOverlay.  If not, see <http://www.gnu.org/licenses/>.                                                                     */
/*************************************************************************/
#include "OverlayConfig.h"
#include <string>
using namespace std;
OverlayConfig* OverlayConfig::instance = NULL;

void OverlayConfig::load()
{
 	config.readFile(".\\config.cfg");
 	overlayZ = config.lookup("overlay.z");
 
 
 	ip = (LPCTSTR)((string)config.lookup("server.ip")).c_str();
 	port = config.lookup("server.port");
 	password = (LPCTSTR)((string)config.lookup("server.password")).c_str();
 
 	activationSpeed = config.lookup("overlay.activation-speed");
 	activationKey = config.lookup("overlay.activation-key");
 	uiPanelTopColor = config.lookup("uipanel.top-color");
 	uiPanelBottomColor = config.lookup("uipanel.bottom-color");
}
OverlayConfig* OverlayConfig::currentInstance()
{
	if(instance == NULL)
	{
		instance = new OverlayConfig();
		instance->load();
	}
	return instance;
}